package cn.jeeweb.modules.web.labor.service.impl;

import cn.jeeweb.core.common.service.impl.CommonServiceImpl;
import cn.jeeweb.core.query.data.Page;
import cn.jeeweb.core.query.data.PageImpl;
import cn.jeeweb.core.query.data.Pageable;
import cn.jeeweb.core.query.data.Queryable;
import cn.jeeweb.core.query.parse.QueryToWrapper;
import cn.jeeweb.modules.web.labor.content.HuEmployPublicContent;
import cn.jeeweb.modules.web.labor.content.HuEmployTrainContent;
import cn.jeeweb.modules.web.labor.mapper.HuEmployPublicMapper;
import cn.jeeweb.modules.web.labor.entity.HuEmployPublic;
import cn.jeeweb.modules.web.labor.service.IHuEmployPublicService;
import com.baomidou.mybatisplus.mapper.Wrapper;
import javafx.scene.control.Pagination;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

/**   
 * @Title: hu_employ_public
 * @Description: hu_employ_public
 * @author public
 * @date 2018-02-27 16:09:25
 * @version V1.0   
 *
 */
@Transactional
@Service("huEmployPublicService")
public class HuEmployPublicServiceImpl  extends CommonServiceImpl<HuEmployPublicMapper,HuEmployPublic> implements  IHuEmployPublicService {

    @Resource
    private HuEmployPublicMapper huEmployPublicMapper;






    public Page<HuEmployPublicContent> selectSpecialtList(Queryable queryable, Wrapper<HuEmployPublicContent> wrapper,Integer state){
        QueryToWrapper<HuEmployPublicContent> queryToWrapper = new QueryToWrapper<HuEmployPublicContent>();
        queryToWrapper.parseCondition(wrapper, queryable);
        // 排序问题
        queryToWrapper.parseSort(wrapper, queryable);
        Pageable pageable = queryable.getPageable();
        com.baomidou.mybatisplus.plugins.Page<HuEmployPublicContent> content = new com.baomidou.mybatisplus.plugins.Page<HuEmployPublicContent>(
                pageable.getPageNumber(), pageable.getPageSize());
        List<HuEmployPublicContent> list=huEmployPublicMapper.selectSpecialtList(content,state);
        content.setRecords(list);
        return new PageImpl<HuEmployPublicContent>(content.getRecords(), queryable.getPageable(), content.getTotal());
    }
}
